package com.jia.springbootcontroller;

import lombok.Data;

import java.util.HashSet;

@Data
public class Bean {

    private String name;

    private String address;

    public static void main(String[] args) {
        HashSet<Bean> set = new HashSet<>();
        for (int i = 0; i <5 ; i++) {
            Bean bean = new Bean();
            bean.setName("name"+i);
            bean.setAddress("address"+i);
            set.add(bean);
        }

        HashSet<Bean> set2 = new HashSet<>();
        for (int i = 0; i <3 ; i++) {
            Bean bean = new Bean();
            bean.setName("name"+i);
            bean.setAddress("address"+i);
            set2.add(bean);
        }
        boolean b = set.removeAll(set2);
        System.out.println(set);
    }
}
